
// console.log( "环境变量:",process.env )
// console.log( "环境变量-自动文件变量-VUE_APP_AJAX_URL:",process.env.VUE_APP_AJAX_URL )
// console.log( "环境变量-自动文件变量-VUE_APP_SERVER_URL:",process.env.VUE_APP_SERVER_URL )

const { defineConfig } = require('@vue/cli-service')
const path = require("path")
module.exports = defineConfig({
  transpileDependencies: true,
  publicPath:"/wbs22042/",
  outputDir:"dist/wbs22042",

  devServer:{
    proxy:{
      "/api":{
        // target:"http://127.0.0.1:3000",
        target:process.env.VUE_APP_SERVER_URL,
        pathRewrite:{
          // 将代理地址进行重写，将重写后的结果提供给真实服务进行请求
          // key:value
          //    key 为路径替换时的正则表达式
          //    value 为替换后的路径，如果需要删除直接取值 “”
          "^/api":""
        },
        logLevel: "debug",
        logProvider:()=>console
      }
    }
  },

  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [
        path.join(__dirname,"./src/assets/less/vars.less") 
      ]
    }
  }
})
